package edu.pku.sei.transformation.qvt.adapter.mediniqvt;

import java.util.ArrayList;

import edu.pku.sei.transformation.editor.model.GraphicalDomain;
import edu.pku.sei.transformation.editor.model.Rule;
import edu.pku.sei.transformation.qvt.adapter.standardqvt.DomainAdapter;
import edu.pku.sei.transformation.qvt.adapter.standardqvt.RelationAdapter;
import edu.pku.sei.transformation.qvt.rule.IDomain;

public class MediniQVTRelationAdapter extends RelationAdapter {

	public MediniQVTRelationAdapter(Rule r) {
		super(r);
	}
	
	@Override
	protected void addDomain() {
		domains = new ArrayList<IDomain>();
		for (Object obj : this.element.getDomains()) {
			if (obj instanceof GraphicalDomain) {
				domains.add(new MediniQVTDomainAdapter((GraphicalDomain) obj));
			} else {
				System.err.println("illegal domain type");
			}
		}
	}

}
